package com.atguigu.udmp.stream.common.util;

import groovy.lang.GroovyClassLoader;

public class GroovyUtil {

    static private GroovyClassLoader groovyClassLoader = new GroovyClassLoader();

    public static   <T>  T    parseGroovyToObject(String groovySource,Class<T> tClass) throws  Exception {
            Class groovyClass = groovyClassLoader.parseClass(groovySource);
            return  (T)groovyClass.newInstance();

    }
}
